<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
        <link rel="stylesheet" type="text/css" href="../../static/news/css/reset.css">
    <link rel="stylesheet" type="text/css" href="../../static/news/css/main.css">
    <script type="text/javascript" src="../../static/news/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../../static/news/js/main.js"></script>
    <link rel="stylesheet" type="text/css" href="../../static/admin/css/layui.css">
    <link rel="stylesheet" type="text/css" href="../../static/admin/css/reset.css">
    <link rel="stylesheet" type="text/css" href="../../static/admin/css/main.css">
    <script type="text/javascript" src="../../static/admin/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../../static/admin/js/jquery.form.min.js"></script>
    <script src="../../static/admin/tinymce/js/tinymce/tinymce.min.js"></script>
    <script src="../../static/admin/js/tinymce_setup.js"></script>


    <script src="../../static/admin/js/news_edit_detail.js"></script>
</head>
<body>
<div class="breadcrub">
    当前位置：接单管理 > 订单详情
</div>

<span id="show_id" style="display:none">{{data.id}}</span>
<div class="message1" style="display:none">{{get_flashed_messages()}}</div>
<div class="pannel">


        <h3 class="review_title"></h3>
        <h2 style="margin-left:40px;color: #ff1800b0;font-size:25px">订单详情</h2>
        <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
         <div class="pannel">
    <table class="common_table1">
        <tr>
            <th width="20%">属性名</th>
            <th width="50%">属性值</th>



        </tr>

            <tr>
                <td>订单号</td>
                {% if data.ext1%}
                <td >{{ data.ext1 }} <a href="https://www.amazon.com/progress-tracker/package/ref=ppx_yo_dt_b_track_package?_encoding=UTF8&itemId=lkmkpshunlqqun&orderId={{data.ext1}}&packageIndex=0&shipmentId=DvNc7nPQ0&vt=YOUR_ORDERS" class="review1" target="_blank">查看物流</a>&nbsp<a href="#" class="review1" id="order_id"> &nbsp&nbsp修改&nbsp&nbsp  </a></td>
                {% elif not data.ext1%}

                <td ><a href="#" class="review1" id="order_id"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>


                {% endif %}
            </tr>

 <tr>
                <td>订单截图</td>
                 {% if data.order_picture %}
                <td><img src="/static/img/order_picture/{{data.order_picture}}">
&nbsp<a class="review1" id="ddjt">&nbsp&nbsp修改&nbsp&nbsp</a>
</td>
              {% elif not data.order_picture%}
              <td ><a href="#" class="review1" id="ddjt"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>
              {% endif %}

            </tr>

         <tr>
             <td>订单状态</td>
             {% if data.status_id==1%}
                <td >未下单</td>
             {% elif data.status_id==2%}
                <td >待上评</td>
             {% elif data.status_id==3%}
                <td >待结账</td>
             {% elif data.status_id==4%}
                <td >已结账</td>
             {% endif%}
            </tr>
          <tr>
                <td>店铺名称</td>
                <td >{{ data.shop_name }}</td>
            </tr>

<tr>
                <td>供应商</td>
                <td >{{ data.ext2 }}</td>
            </tr>

       <tr>
                <td>接单时间</td>
                <td >{{ data.jiedan_time }}</td>
            </tr>
      <tr>
                <td>商品图片</td>
               <td><img src="/static/img/item_picture/{{data.item_picture}}"></td>

            </tr>
             <tr>
                <td>站点</td>
                 {% if data.site_id==1%}
                <td >US</td>
                  {% elif data.site_id==2%}
                <td >UK</td>
                     {% elif data.site_id==3%}
                <td >DE</td>
                 {% elif data.site_id==4%}
                <td >CA</td>
                 {% endif %}
            </tr>
             <tr>
                <td>ASIN</td>
                <td >{{ data.ASIN }}</td>
            </tr>
             <tr>
                <td>卖家类型</td>
                 {% if data.seller_id==1%}
                <td >买家</td>
                 {% elif data.seller_id==2%}
                <td >卖家</td>
                {% endif %}
            </tr>
             <tr>
                <td>下单金额</td>
                <td >{{ data.amount }}</td>
            </tr>
             <tr>
                <td>录入人员</td>
                <td >{{ data.staff_name }}</td>
            </tr>
             <tr>
                <td>是否提供评论</td>
                 {% if data.offer_comment %}
                <td >是</td>
                 {% elif data.offer_comment %}
                <td >否</td>
                 {% endif%}
            </tr>
             <tr>
                <td>关键词</td>
                <td >{{ data.keywords }}</td>
            </tr>
          <tr>
                <td>评论地址</td>
              {% if data.comment_url %}
                <td >{{ data.comment_url }} &nbsp<a href="#" class="review1" id="pldz"> &nbsp&nbsp修改&nbsp&nbsp  </a></td>
              {% elif not data.comment_url%}
              <td ><a href="#" class="review1" id="pldz"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>
              {% endif %}
            </tr>

        <tr>
                <td>评论截图</td>
            {% if data.comment_picture %}
               <td><img src="/static/img/comment_picture/{{data.comment_picture}}"> &nbsp<a href="#" class="review1" id="pljt"> &nbsp&nbsp修改&nbsp&nbsp  </a></td>
              {% elif not data.comment_picture%}
              <td ><a href="#" class="review1" id="pljt"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>
              {% endif %}


            </tr>
        <tr>
                <td>付款截图</td>
                {% if data.pay_picture %}
                <td><img src="/static/img/pay_picture/{{data.pay_picture}}">&nbsp<a href="#" class="review1" id="fkjt"> &nbsp&nbsp修改&nbsp&nbsp  </a></td>
              {% elif not data.pay_picture%}
              <td ><a href="#" class="review1" id="fkjt"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>
              {% endif %}

            </tr>
        <tr>
                <td>备注</td>
                {% if data.ps %}
                <td >{{ data.ps }} &nbsp<a href="#" class="review1" id="ps"> &nbsp&nbsp修改&nbsp&nbsp  </a></td>
              {% elif not data.ps%}
              <td ><a href="#" class="review1" id="ps"> &nbsp&nbsp添加&nbsp&nbsp  </a></td>
              {% endif %}

            </tr>
    </table>
</div>


</div>

<div class="login_form_con">
    <div class="login_form">
        <div class="login_title">
            <h3>订单信息添加</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>
        <div class="form_group">
            <input id="mobile" type="text" name="mobile" autocomplete="off">
            <div class="input_tip">订单号</div>
            <div id="login-mobile-err" class="error_tip">订单号不能为空</div>
        </div>

        <input type="submit" id="submit_data" value="添加" class="input_sub">
        <div class="down_link"><a href="javascript:;" class="to_register">取消</a></div>
    </div>
    <div class="mask"></div></div>

<div class="login_form_con1" style="display:none">
    <div class="login_form">
        <div class="login_title">
            <h3>订单信息添加</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>
        <div class="form_group">
            <input id="mobile" type="text" name="mobile" autocomplete="off">
            <div class="input_tip">评论地址</div>
            <div id="login-mobile-err" class="error_tip">评论地址不能为空</div>
        </div>

        <input type="submit" id="submit_data1" value="添加" class="input_sub">
        <div class="down_link"><a href="javascript:;" class="to_register">取消</a></div>
    </div>
    <div class="mask"></div></div>


<div class="login_form_con2" style="display:none">
    <div class="login_form">
        <div class="login_title">
            <h3>订单信息添加</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>
        <div class="form_group">
            <input id="mobile" type="text" name="mobile" autocomplete="off">
            <div class="input_tip">备注</div>
            <div id="login-mobile-err" class="error_tip">评论地址不能为空</div>
        </div>

        <input type="submit" id="submit_data2" value="添加" class="input_sub">
        <div class="down_link"><a href="javascript:;" class="to_register">取消</a></div>
    </div>
    <div class="mask"></div></div>

<input type="hidden" id="csrf" value="{{ csrf_token() }}"/>


<div class="login_form_con3" style="display:none">
    <div class="login_form">
        <div class="login_title">
            <h3>订单截图</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>

        <div class="layui-upload-drag" id="test10" style="margin-left: 35px;margin-top: 35px;">
  <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处</p>
</div>
        <br>
        <br>
        <div style="text-align: center;font-size: 30%;"> <a href="#" class="to_register" >取消</a></div>
    </div>
    <div class="mask"></div></div>



<div class="login_form_con4" style="display:none">
    <div class="login_form">
        <div class="login_title">
            <h3>评论截图</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>

        <div class="layui-upload-drag" id="test11" style="margin-left: 35px;margin-top: 35px;">
  <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处</p>
</div>
        <div style="text-align: center;font-size: 30%;"> <a href="#"  class="to_register" >取消</a></div>
    </div>
    <div class="mask"></div></div>



<div class="login_form_con5" style="display:none">
    <div class="login_form">
        <div class="login_title">
            <h3>付款截图</h3>
            <a href="javascript:;" class="shutoff"></a>
        </div>

        <div class="layui-upload-drag" id="test12" style="margin-left: 35px;margin-top: 35px;">
  <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处</p>
</div>
         <div style="text-align: center;font-size: 30%;"> <a href="#" class="to_register" >取消</a></div>
    </div>
    <div class="mask"></div></div>

<script src="../../static/admin/js/layui.js" charset="utf-8"></script>
    <script>

$(document).ready(function(){
$("#order_id").click(function(){
       $(".login_form_con").show();
   })

   $("#pldz").click(function(){
       $(".login_form_con1").show();
   })

   $("#ps").click(function(){
       $(".login_form_con2").show();
   })

    $("#ddjt").click(function(){
       $(".login_form_con3").show();
       var dd=1
       var bb=0
       var cc=0
       if(dd==1){
console.log(dd)
var order_id=$("#show_id").text()
var a= $("#csrf").val()
var url="http://127.0.0.1:5000/admin/test_date"+"/"+order_id+"h"
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;

  //拖拽上传
  upload.render({
    elem: '#test10'
     ,headers:{
                'X-CSRFToken': a,
            }
    ,url: url
    ,done: function(res){
      $("#login_form_con3").hide()
      location.reload();
      layer.msg('上传成功');
      layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
    }
  });
});}



   })

    $("#pljt").click(function(){
       $(".login_form_con4").show();
       var dd=0
       var bb=1
       var cc=0
       if(bb=1){
var order_id=$("#show_id").text()
var a= $("#csrf").val()
var url="http://127.0.0.1:5000/admin/test_date1"+"/"+order_id+"h"
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;

  //拖拽上传
  upload.render({

    elem: '#test11'
     ,headers:{
                'X-CSRFToken': a,
            }
    ,url: url
    ,done: function(res){
      $("#login_form_con4").hide()
      location.reload();
      layer.msg('上传成功');
      layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
    }
  });
});}


   })
    $("#fkjt").click(function(){
       $(".login_form_con5").show();
        var dd=0
       var bb=0
       var cc=1
       if(cc=1){
var order_id=$("#show_id").text()
var a= $("#csrf").val()
var url="http://127.0.0.1:5000/admin/test_date2"+"/"+order_id+"h"
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;

  //拖拽上传
  upload.render({
    elem: '#test12'
     ,headers:{
                'X-CSRFToken': a,
            }
    ,url: url
    ,done: function(res){
      $("#login_form_con5").hide()
      location.reload();
      layer.msg('上传成功');
      layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.files.file);
    }
  });
});}


   })

$(".to_register").click(function(){
       $(".login_form_con1").hide();
       $(".login_form_con2").hide();
       $(".login_form_con3").hide();
       $(".login_form_con4").hide();
       $(".login_form_con5").hide();
   })
});


//添加订单号
   $("#submit_data").click(function(){
            var order = $(".login_form_con .login_form #mobile").val()
            var order_id=$("#show_id").text()
            console.log(121)
            if (!order) {
                console.log('show')
                $("#login-mobile-err").show();
                return;
            }

        // 发起请求
            var params = {
                "order_id":order_id,
                "order": order,
                "pldz":"None",
                "ddjt":"None",
                "pljt":"None",
                "fkjt":"None",
                "ps":"None",
            }
            $.ajax({
            url: "/admin/add_info",
            method: "post",
            data: JSON.stringify(params),
            contentType: "application/json",
            headers:{
                'X-CSRFToken': getCookie('csrf_token')
            },
            success: function (resp) {
                location.reload();
                if (resp.errno == "0") {
                    // 刷新当前界面
                    location.reload();
                } else {
                    $("#login-password-err").html(resp.errmsg)
                    $("#login-password-err").show()
                }
            }
        })
   })
 //添加评论地址
    $("#submit_data1").click(function(){
            var pldz = $(".login_form_con1 .login_form #mobile").val()
            var order_id=$("#show_id").text()

            if (!pldz) {
                $("#login-mobile-err").show();
                return;
            }
        // 发起请求
            var params = {
                "order_id":order_id,
                "order": "None",
                "pldz":pldz,
                "ddjt":"None",
                "pljt":"None",
                "fkjt":"None",
                "ps":"None",
            }
            $.ajax({
            url: "/admin/add_info",
            method: "post",
            data: JSON.stringify(params),
            contentType: "application/json",
            headers:{
                'X-CSRFToken': getCookie('csrf_token')
            },
            success: function (resp) {
                location.reload();
                if (resp.errno == "0") {
                    // 刷新当前界面
                    location.reload();
                } else {
                    $("#login-password-err").html(resp.errmsg)
                    $("#login-password-err").show()
                }
            }
        })
   })

    //添加备注
    $("#submit_data2").click(function(){
            var ps = $(".login_form_con2 .login_form #mobile").val()
            var order_id=$("#show_id").text()

            console.log(112121)
            if (!ps) {
                $("#login-mobile-err").show();
                return;
            }
        // 发起请求
            var params = {
                "order_id":order_id,
                "order": "None",
                "pldz":"None",
                "ddjt":"None",
                "pljt":"None",
                "fkjt":"None",
                "ps":ps,
            }
            $.ajax({
            url: "/admin/add_info",
            method: "post",
            data: JSON.stringify(params),
            contentType: "application/json",
            headers:{
                'X-CSRFToken': getCookie('csrf_token')
            },
            success: function (resp) {
                location.reload();
                if (resp.errno == "0") {
                    // 刷新当前界面
                    location.reload();
                } else {
                    $("#login-password-err").html(resp.errmsg)
                    $("#login-password-err").show()
                }
            }
        })
   })
    </script>

</body>
</html>
